package cn.lucky.se.jdk8;

import java.util.Arrays;
import java.util.List;
import java.util.function.Predicate;

/**
 * @author lingpeng.jiang
 * @create 2020-11-25-22:21
 */
public class Lambda {

    public static void main(String[] args) {
        /*FunctionInterface functionInterface = s -> System.out.println("hello,"+s);
        functionInterface.printerSay("大白");*/
        List<Integer> nums = Arrays.asList(1,2,3,4,5,6,7,8,9);
        eval(nums,n -> n % 2 == 0);
    }


    public static void eval(List<Integer> numbers, Predicate<Integer> predicate){
        for (Integer num :numbers){
            if (predicate.test(num)){
                System.out.print(num + "  ");
            }
        }
    }
}
